package com.lbw.controller;




import com.lbw.product.entity.Product;
import com.lbw.service.IProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Resource
    private IProductService productService;

    /**
     * 根据商品id查询商品信息
     * @param productId
     * @return
     */
    @GetMapping("{productId}")
    public Product getProduct(@PathVariable Long productId) {
        Product product = productService.getProductById(productId);
        return product;
    }

}
